import React from "react";
import { CartConsumer } from "./Cart";

const Child2 = () => {
  return (
    <CartConsumer>
      {(value) => {
        return (
          <>
            <button onClick={value.minus}>-</button>
            <span>{value.count}</span>
            <button onClick={value.add}>+</button>
          </>
        );
      }}
    </CartConsumer>
  );
};

export default Child2;
